<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"></script>
</head>

<body>
  <div id="app">
    <!-- v-if是用来决定元素是否在dom中渲染, 如果值为false, 那么对应的元素则不会被渲染出来 -->
    <h2 v-if="isShow">{{message}}</h2>
    <!-- v-show是用来决定元素是否在dom中显示的, 如果值为false,则会在对应的元素加上行内样式, display="none" -->
    <h2 v-show="isShow">{{message}}</h2>
  </div>
  <script>
    const app = new Vue({
      el: "#app",
      data: {
        message: "你好呀",
        isShow: true
      }
    })
  </script>
</body>

</html>